package spring.chatroom.mapper.plusSql;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import spring.chatroom.java_chatroom.mapper.FriendTableMapper;
import spring.chatroom.java_chatroom.pojo.model.friendTable;

import java.util.List;

@Component
public class FriendTableSql {
    @Autowired
    FriendTableMapper friendTableMapper;

    public List<friendTable> getFriendTableBySessionId(int sessionId) {
        QueryWrapper<friendTable> wrapper = new QueryWrapper<>();
        wrapper.select("user_id")
                .eq("session_id", sessionId);
        return friendTableMapper.selectList(wrapper);
    }
}
